import Vue from 'vue'
import App from './App.vue'

// 导入vue-router
import VueRouter from 'vue-router';

//在vue对象中通过use()来使用vue-router
 Vue.use(VueRouter);

// 定义路由对象并且初始化路由规则
// 导入组件
import subjects from './components/in_theaters/subjects.vue';
import movieinfo from './components/movieinfo/movieinfo.vue';
import coming from './components/coming_soon/coming.vue';
import top250 from './components/top250/top250.vue';
import like from './components/like/like.vue';

var router = new VueRouter({
  routes:[
    {path:'/',redirect:'/subjects'},
    {name:'in_theaters',path:'/subjects',component:subjects},//正在热映组件
    {name:'movieinfo',path:'/movie/:id',component:movieinfo},//电影详情页
    {name:'coming_soon',path:'/coming',component:coming},//即将上映
    {name:'top250',path:'/top250',component:top250},//top250页面
    {name:'like',path:'/like',component:like},//top250页面
  ],
  linkActiveClass:'mui-active',
});

//导入mint-ui样式
import 'mint-ui/lib/style.min.css';

//导入mint-ui组件包
import mintUI from 'mint-ui';

Vue.use(mintUI);

// 导入mui的css
import '../statics/mui/css/mui.css';
import '../statics/mui/css/icons-extra.css'

//导入vue-resource
import VueResource from 'vue-resource';
Vue.use(VueResource);

//自定义全局过滤器

//分割数组
Vue.filter('shuzufmt',input=>{
  if(!input ){
    return;
  }
  var newArr = input.join('、');
  return newArr;
});



//导入site.css通用样式
import '../statics/css/stie.css';

new Vue({
  el: '#app',
  router,
  render: h => h(App)
})
